import request from "@/utils/request";

const Monitor_BASE_URL = "/system/monitor";

const MonitorAPI = {
  getServerInfo() {
    return request<any, ServerVO>({
      url: `${Monitor_BASE_URL}/info`,
      method: "get",
    });
  },
};

export default MonitorAPI;

export interface ServerVO {
  sys: SysVO;
  cpu: CpuVO;
  memory: StorageVO;
  swap: StorageVO;
  disk: StorageVO;
  time: string;
}

export interface SysVO {
  os?: string;
  day?: string;
  ip?: string;
}

export interface CpuVO {
  name?: string;
  packageCount?: string;
  core?: string;
  coreNumber?: string;
  logic?: string;
  used: string;
  idle?: string;
}

export interface StorageVO {
  total: string;
  available: string;
  used: string;
  usageRate: string;
}
